package realDeal;

import sun.security.util.BitArray;

public abstract class Statics {

	public static int TOTAL_INCREMENTS; // aka M
	public static int TOTAL_OBJECTS; // aka N
	public static int MAX_WIDTH; // aka L
	public static int BUCKET_SIZE; // aka k
	public static int AMOUNT_BOUCKET;

	/**
	 * Increment a given BitArray value by 1. The change will be reflected in
	 * the given object.
	 * 
	 * @param array
	 *            - the BitArray
	 * @return - true in case increase resulted a carry or false otherwise
	 */
	public static boolean incrementBitArray(BitArray array) {
		boolean carryStatus = true;
		for (int i = array.length()-1; i >= 0; i--) {
			boolean currentValue = array.get(i);
			array.set(i, !currentValue);
			if (!currentValue) { // was zero, so no carry
				carryStatus = false;
				break;
			}
		}
		return carryStatus;
	}
	
}
